package dmxGroupControl.ui;

import javafx.application.Application;
import javafx.stage.Stage;

public class Main extends Application 
{
    static Main instance;
	
    Stage stage;
    Application currentWindow;
    
    static Main GetInstance()
    {
        return instance;
    }
    
    void SetStage(String venueFile, boolean editor)
    {
        String fullFilename = "data/venues/" + venueFile;
        if(editor)
        {
            stage.close();
            currentWindow = new UniverseEditWindow(fullFilename);
        }
        else
        {
            currentWindow = new fxWindow(fullFilename);
        }
        try
        {
            currentWindow.start(stage);
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
    
	@Override
	public void start(Stage primaryStage) 
	{
	    instance = this;
	    this.stage = primaryStage;
	    
		Application window;
		/**/
		
		window = new VenueSelectionWindow();
		
		try
		{
			window.start(primaryStage);
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}

	public static void main(String[] args) 
	{
		launch(args);
	}
}
